﻿@page "/daily/inhabitant";
@namespace YwhWeb.Pages.Daily

<div style="text-align: right;">

    <PageContainer Title="房屋信息" Style="right">
        <Content>   
            <Button @onclick="_=>NewDrawer()">添加房屋信息</Button> 
            
            </Content>

        
            <ChildContent>
            <Table @ref="table"
                   TItem="YwhLib.Inhabitant"
                   DataSource="@inhabitantRsp.Items"
                   Total="_total"
                   @bind-PageIndex="_pageIndex"
                   @bind-PageSize="_pageSize"
                   @bind-SelectedRows="selectedRows"
                   OnChange="OnChange">
                <Selection Key="@(context.InhabitantId.ToString())" />
                <AntDesign.Column Title="居住者ID" @bind-Field="@context.InhabitantId" Sortable />
                <AntDesign.Column Title="房屋编号" @bind-Field="@context.RoomId" Sortable />
                <AntDesign.Column Title="房屋信息" @bind-Field="@context.Room" Sortable />

@*              <AntDesign.Column Title="期号" Field="@context.Room.PhaseNo" />
                <AntDesign.Column Title="楼号" Field="@context.Room.BuildingNo" />
                <AntDesign.Column Title="单元号" Field="@context.Room.UnitNo" />
                <AntDesign.Column Title="房号" Field="@context.Room.RoomNo" />*@
               
                <AntDesign.Column Title="姓名" Field="@context.Name" />
                <AntDesign.Column Title="身份" Field="@context.Identity" />
                <AntDesign.Column Title="手机号" Field="@context.Phone" />
            </Table>
            </ChildContent>
    </PageContainer>
</div>

<Drawer Visible="this.drawerVisible" Width="400" OnClose="a=>{this.drawerVisible=false;}">
    <Title Level="4">添加信息</Title>
    <div>
    <p ></p>
 </div>

 <Text>房屋编号:</Text>
 <div>

<Select DataSource="@phaseOptions"
        @bind-Value="@editInhabitant.PhaseNo"
        ValueName="@nameof(Phase.PhaseNo)"
        LabelName="@nameof(Phase.PhaseNoS)"
        Style="width: 300px"
        Placeholder="请选择期号"
        AllowClear
        OnSelectedItemChanged="OnSelectedItemChangedHandlerPhase">
</Select>
<p></p>
<Select DataSource="@buildingOptions"
        @bind-Value="@editInhabitant.BuildingNo"
        ValueName="@nameof(Building.BuildingNo)"
        LabelName="@nameof(Building.BuildingNoS)"
        Style="width: 300px"
        Placeholder="请选择楼号"
        AllowClear
        OnSelectedItemChanged="OnSelectedItemChangedHandlerBuilding">
</Select>
<p></p>
<Select DataSource="@unitOptions"
        @bind-Value="@editInhabitant.UnitNo"
        ValueName="@nameof(Unit.UnitNo)"
        LabelName="@nameof(Unit.UnitNoS)"
        Style="width: 300px"
        Placeholder="请选择单元号"
        AllowClear
        OnSelectedItemChanged="OnSelectedItemChangedHandlerUnit">
</Select>
<p></p>
<Select DataSource="@roomOptions"
        @bind-Value="@editInhabitant.RoomNo"
        ValueName="@nameof(Room.RoomNo)"
        LabelName="@nameof(Room.RoomNoS)"
        Style="width: 300px"
        Placeholder="请输入房号"
         OnSelectedItemChanged="OnSelectedItemChangedHandlerRoom">
        AllowClear>
</Select>

 </div>
</Drawer>



